const readline = require('readline');

// 创建接口实例
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

// 创建用户对象
const user = {};

// 逐步提示输入信息
rl.question('请输入姓名：', (name) => {
    user.name = name;
    rl.question('请输入邮箱：', (email) => {
        user.email = email;
        rl.question('请输入QQ号：', (qq) => {
            user.qq = qq;
            rl.question('请输入手机号码：', (phone) => {
                user.phone = phone;
                
                // 输出完整信息
                console.log('\n用户信息：');
                console.log(user);
                
                // 关闭输入
                rl.close();
            });
        });
    });
});